home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Interactive 7
/
PC World Interactive 7.iso
/
program
/
vbkontrol.exe
/
BASCDE12.ZIP
/
BASCODE.LIB
< prev
next >
Wrap
Text File
|
1994-02-21
|
4KB
|
111 lines
BASCODEV1***
LIBRARYNAME : BASCODE
DESCRIPTION : BasCode Shareware Library
))))))))))))))))))))))))))))))))))))))
CODETITLE : To Shell To Dos
DESCRIPTION : Function to shell to Dos/Other App and stay in function until finished. Returns ID/Error Code.
DATESTORED : 01-20-1994
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
Function ToShellToDos (commandline As String) As Long
Rem ** API to discover if a program is executing By M.Brewerton 1993**
Rem ** Declare Function GetModuleUsage% Lib "Kernel" (ByVal hProgram%) **
Rem ** Routine To Shell To Dos And Stay In This Routine Until Task Is Complete **
s% = Shell(commandline$) 'shells out with the command in commandline$
While GetModuleUsage(s%) 'checks to see if finished
x% = DoEvents() 'allows it to continue if unfinished.
Wend
ToShellToDos = s% 'returns task ID or error code from function.
End Function
((((((((((((((((((((((((((((((((((((((
))))))))))))))))))))))))))))))))))))))
CODETITLE : Check For Another
DESCRIPTION : Will Check To See If Program Is Running.
DATESTORED : 01-20-1994
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
Function CheckInstance (fi As String) As Long
Rem ** Check to see if program already executing **
Rem ** Include The Following API **
Rem ** Declare Function GetModuleHandle% Lib "Kernel" (ByVal lpProgramName$) **
Rem ** Declare Function GetModuleUsage% Lib "Kernel" (ByVal hProgram%) **
hw% = GetModuleHandle(fi$)
CheckInstance = GetModuleUsage(hw%)
Rem ** Returns a value of greater than 1 if fi$ loaded **
End Function
((((((((((((((((((((((((((((((((((((((
))))))))))))))))))))))))))))))))))))))
CODETITLE : Centre Your Form
DESCRIPTION : Gets Screen/Form Limits And Then Places Form In Centre.
DATESTORED : 01-20-1994
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
Sub Centreform (Form As Form)
Rem ** routine that centres the form control on the screen control **
Rem ** M.Brewerton 1993 **
sh = screen.Height
sw = screen.Width
fw = Form.Width
fh = Form.Height
Form.Top = (sh / 2) - (fh / 2)
Form.Left = (sw / 2) - (fw / 2)
End Sub
((((((((((((((((((((((((((((((((((((((
))))))))))))))))))))))))))))))))))))))
CODETITLE : Get StartUp Directory
DESCRIPTION : Function that will return the startup directory of a given program e.g. "BASCODE.EXE"
DATESTORED : 01-20-1994
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
Function Startup (fi As String) As String
Rem ** API to check for Startup Directory, Place In Module **
Rem ** Declare Function GetModuleFileName% Lib "kernel" (ByVal hModule%, ByVal FileName$,
ByVal nSize%) **
Rem ** Finds and returns the startup directory of fi$ **
Rem ** Presuming that it is running at the present time. **
hModule% = GetModuleHandle(fi$)
buffer$ = Space$(255)
Length% = GetModuleFileName(hModule%, buffer$, Len(buffer$))
buffer$ = Left$(buffer$, Length%)
Startup = buffer$
End Function
((((((((((((((((((((((((((((((((((((((
))))))))))))))))))))))))))))))))))))))
CODETITLE : Restart Windows
DESCRIPTION : How to Use API to Ask Windows To Restart
DATESTORED : 01-21-1994
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
REM ** How To Restart Windows **
REM ** Place API below in MODULE **
REM ** (Paul Smith) **
Declare Function ExitWindows% Lib "User" (ByVal dwReserved&, ByVal wReturnCode%)
x% = ExitWindows(66, 66)
((((((((((((((((((((((((((((((((((((((
))))))))))))))))))))))))))))))))))))))
CODETITLE : Search List By API
DESCRIPTION : Search through a List for a text string using API (Don Funk, API)
DATESTORED : 01-20-1994
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
REM ** Code Segment By Don Funk, MS **
REM ** Searches LIST for Occurrance Of Text **
REM ** Place Following API is Module **
Declare Function SendMessage& Lib "user" (ByVal hWnd%, ByVal wMsg%,ByVal wParam%,ByVal lParam As String)
Declare Function Getfocus% Lib "user" ()
Dim ListHwnd As Integer
Sub Form_Click ()
List1.AddItem "John":List1.AddItem "George":List1.AddItem "Sue"
End Sub
Sub Text1_Change ()
Const LB_SELECTSTRING = &H400 + 13
Static X As Long
wParam = 1
lParam$ = Text1.Text + Chr$(0)
X = SendMessage(ListHwnd, LB_SELECTSTRING, wParam, lParam$)
Print X
End Sub
Sub Form_Load ()
Form1.Show
List1.SetFocus
ListHwnd = Getfocus()
End Sub
((((((((((((((((((((((((((((((((((((((